import { createApp } from 'vue';

import TDesign from 'tdesign-vue-next';
import 'tdesign-vue-next/es/style/index.css';
import { VueMasonryPlugin } from 'vue-masonry';
import { store } from './store'; 
import router from './router';  
import '@/freeStyle/index.less'; 
import App from './App.vue';
import { getLinkUrl } from './utils/request/upload';
import waterfall from 'vue-waterfall2';
import '@/utils/rem.js';
import 'amfe-flexible'; //引入rem自适应
// import '@imengyu/vue3-context-menu/lib/vue3-context-menu.css'
import 'shufflemanvue3-context-menu/lib/vue3-context-menu.css';
import { ElTree } from 'element-plus';
import 'element-plus/dist/index.css';
import { TextEllipsis, ImagePreview } from 'vant';
import VueLazyload from 'vue-lazyload';

import Vue3DraggableResizable from 'vue3-draggable-resizable';
//需引入默认样式
import 'vue3-draggable-resizable/dist/Vue3DraggableResizable.css';

const app = createApp(App);
app.config.globalProperties.$filters = {
  getLinkUrl,
};
app.use(TDesign);
app.use(store);
app.use(router);
app.use(waterfall);
app.use(ElTree); 
app.use(ImagePreview);
app.use(TextEllipsis);
app.use(Vue3DraggableResizable);
// app.use(ContextMenu);
app.use(VueMasonryPlugin);
app.use(VueLazyload, {
  preLoad: 1.3, // 预加载高度比例
  error: '', // 图片加载失败后的默认图片
  loading: '', // 图片加载时的默认图片
  attempt: 3, // 尝试加载图片的次数
});

app.mount('#app');
